home *** CD-ROM | disk | FTP | other *** search
- /*
- * KEYS.C Copyright (C) 1990 by Mark R. Nelson
- *
- * This routine is used to read a character or extended character
- * in from the keyboard. It returns immediately if no character is
- * available, returning a -1 to indicate no key. A few of the
- * extended key codes are defined in KEYS.H
- */
- #include <conio.h>
-
- int getkey()
- {
- int c;
-
- if ( !kbhit())
- return( -1 );
- c = getch();
- if ( c != 0 )
- return( c );
- else
- return( getch() << 8 );
- }
-